import { $get, $put } from '@js/authRequest'
import { message } from 'antd'

export async function getListRequest (params) {
  const res = await $get('/api/xapc/board', {
    params
  })
  if (res.status !== 1) {
    message.error(res.message)
    throw new Error(res.message)
  }
  return res.data
}

export async function delRequest (id) {
  const res = await $put(`/api/xapc/board/${id}`, {
    status: 0
  })
  return res.data
}

export async function getStructureListRequest () {
  const res = await $get('/api/mgt/institutionstat', {
    condition: JSON.stringify([{ k: 'pid', o: 'null' }])
  })
  return res.data
}
